<!-- 商品评价详情弹窗 -->
<template>
            <a-form
                    ref="form3"
                    class="ele-form-detail"
                    :model="evaluationModalApp.evaluation"
                    :label-col="{md: {span: 2}, sm: {span: 4}, xs: {span: 6}}"
                    :wrapper-col="{md: {span: 22}, sm: {span: 20}, xs: {span: 18}}">
                <a-descriptions :title="evaluationModalApp.title" bordered>
                                    <a-descriptions-item label="标识">
                        {{ evaluationModalApp.evaluation.Eid }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建人">
                        {{ evaluationModalApp.evaluation.creatorName }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="名称">
                        {{ evaluationModalApp.evaluation.name }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="评分">
                        {{ evaluationModalApp.evaluation.score }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="评价内容">
                        {{ evaluationModalApp.evaluation.content }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="评价时间">
                        {{ evaluationModalApp.evaluation.date }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="用户">
                        {{ evaluationModalApp.evaluation.userId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="追评">
                        {{ evaluationModalApp.evaluation.evaluationsId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="商品">
                        {{ evaluationModalApp.evaluation.commodityId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="订单">
                        {{ evaluationModalApp.evaluation.orderId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="状态">
                        {{ evaluationModalApp.evaluation.status }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建人ID">
                        {{ evaluationModalApp.evaluation.creatorId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="备注">
                        {{ evaluationModalApp.evaluation.remark }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建时间">
                        {{ evaluationModalApp.evaluation.createDatetime }}
                    </a-descriptions-item>
                                </a-descriptions>
            </a-form>
</template>

<script>
    import {defineComponent, reactive, onMounted, inject} from "vue";
    import {useRoute} from "vue-router"
    import {EvaluationService} from "@/views/mall/good/evaluation/evaluationService";

    export default defineComponent({
        setup() {
            const route = useRoute();
            let routeId = route.params.id;
            let evaluationListApp = inject('evaluationListApp', reactive({}));
            const evaluationModalApp = reactive({id: null, evaluation: {}, display: false});

            onMounted(() => {
                    evaluationModalApp.evaluation = {};
                if (routeId) {
                        evaluationModalApp.id = routeId;
                } else if (evaluationListApp.viewModalShowing) {
                        evaluationModalApp.id = evaluationListApp.currentId;
                        evaluationModalApp.display = true;
                }
                if (evaluationModalApp.id) {
                    getInfo(evaluationModalApp.id);
                }
            })

            const getInfo = (id) => {
                    EvaluationService.findEvaluation(id).then((res) => {
                            evaluationModalApp.evaluation = res.data;
                            evaluationModalApp.title = "查看 " + evaluationModalApp.evaluation.name;
                })
            }

            return {
                    evaluationModalApp,
                routeId,
                getInfo,
            }
        }
    })
</script>

<style scoped>
</style>

